opentelemetry-exporter-otlp-proto-http: add max request size limit to OTLP HTTP exporters#5369
Open
Krishnachaitanyakc wants to merge 1 commit into
Open
Conversation
herin049
requested changes
Jun 30, 2026
… OTLP HTTP exporters Implements the client side of opentelemetry-proto#782: serialized OTLP/HTTP requests larger than a configurable limit are dropped before sending, measured before compression. Adds a max_request_size keyword-only argument to the trace, log, and metric HTTP exporters. Default 64 MiB; 0 (or any non-positive value) disables. Mirrors opentelemetry-go#8157. Refs open-telemetry#4533.
d487296 to
7b30681
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Implements the client side of opentelemetry-proto#782: the OTLP/HTTP exporters drop a serialized request larger than a configurable limit (measured before compression) instead of sending it. Adds a
max_request_sizeargument andOTEL_EXPORTER_OTLP_MAX_REQUEST_SIZE(plus per-signal_TRACES_/_METRICS_/_LOGS_overrides) to the trace, log, and metric HTTP exporters. Default 64 MiB (the spec's RECOMMENDED value, enabled);0(or any non-positive value) disables. Mirrors opentelemetry-go#8157.Behavior-change note: with the default-on limit, batches whose serialized size exceeds 64 MiB (previously sent) are now dropped client-side and recorded as a failed export. gRPC exporters are out of scope here and will follow separately.
Related to #4533 (this is the proactive request-size half; reactive 413 splitting is tracked in #5032).
Type of change
How Has This Been Tested?
Session.post(asserted not called);0/negative disables; env precedence (constructor > per-signal > generic > default) including malformed/empty fallback; failed-export metric recordserror.type.Does This PR Require a Contrib Repo Change?
Checklist: